<template name="goodsdetail">
  <div class="s7-content">
    {{#if goods.img_ids}}
    <div class="swiper-container s7-swiper" style="height:180px;margin-top:0 !important">
      <div class="swiper-wrapper">
        {{#each goods.img_ids}}
        <div class="swiper-slide pb-view">
          <img class="s7-slide" src="{{path}}">
        </div>
        {{/each}}
      </div>
      <div class="swiper-pagination"></div>
    </div>
    {{/if}}

    <div class="s7-detail-title">
      <div class="s7-detail-title-1" style="font-size:1.0rem">{{goods.name}}</div>
      <div class="s7-detail-title-3">
        <span class="s7-detail-p">
          <span style="color:#0188FB;font-size:1.3rem">￥{{goods.sell_price}}</span>
          <span style="font-size:0.8rem;color:#3C414E">&nbsp;&nbsp;门市价：￥{{goods.market_price}}</span>
        </span>
        <a href="/goodsBuy?goods_id={{goods.id}}&merchant_id={{goods.merchant_id}}" class="external buy-now"><span class="s7-detail-buy" style="letter-spacing:2px;width:90px">立即抢购</span></a>
      </div>
      <div class="s7-detail-title-4" style="border:none;border-top:1px solid #ddd">
        <a href="/merchantMap/{{merchant.lng}}/{{merchant.lat}}">
        <div style="width:70%;float:left;white-space:normal; word-break:break-all;overflow:hidden;">
          <span style="font-size:0.9rem !important;"><strong>{{merchant.name}}</strong></span><br>
          <span><i class="icon iconfont icon-ditu" style="font-size:1rem"></i>&nbsp;{{merchant.address}}</span>
        </div>
        </a>
        <a href="tel:{{merchant.phone}}" class="external">
          <div class="s7-m-tel" style="border:none">
          </div>
        </a>
      </div>
    </div>
    {{#with goods}}
    {{#if coupons}}
    <div style="margin:5px 0px;background:#fff;">
      <div style="height:25px;border-bottom:1px solid #ddd;padding-left:15px">券列表</div>
    {{#each coupons}}
    <div class="s7-coupon">
      <div class="s7-coupon-left">
        <span style="font-size:1.1rem;color:#ff0000">
          {{coumoney type des}}
        </span><br>
        <span style="font-size:0.8rem">
          {{fulls type full}}
        </span>
      </div>
      <div class="s7-coupon-right">
        <div class="s7-coupon-title">
          {{goods.merchant.name}}
        </div>
        <div class="s7-coupon-center">
          <div style="float:left">
            {{coutype type}}
          </div>
        </div>
        <div>有效期：{{start_time}}至{{end_time}}</div>
      </div>
    </div>
    {{/each}}
  </div>
    {{/if}}
    <div class="s7-box-text">
      <div style="height:25px;border-bottom:1px solid #ddd">商品详情</div>
      {{strtohtml introduction}}
    </div>
    {{/with}}
  </div>
  <a href="/goodsBuy?goods_id={{goods.id}}&merchant_id={{goods.merchant_id}}" class="external">
  <div class="s7-fix-bottom">
    <span style="position:absolute;top:10px;left:15px;width:30px;height:50px;color:#fff">
    立即<br>
    抢购
  </span>
  </div>
  </a>
  <script>
  $(function(){
    $(document).on('touchmove',function(e){
        var scrollY = $('.buy-now').offset().top;
        if(scrollY < 20){
            $('.s7-fix-bottom').show();
        }else{
            $('.s7-fix-bottom').hide();
        }
     });
});
  </script>
</template>
